

#ifndef   __SIMPHONY_APPLICATION
#define   __SIMPHONY_APPLICATION

#define   CALL_NUMBER_SIZE		15  /* Number == 16 + 1 byte for end of string */

#define   INTERNAL					0
#define   EXTERNAL					1
#define   EXTERNAL_OWNER_PHONE	2

#define   ARM		1
#define   DISARM 	0

extern near bit System_Mode;
extern near bit CHANGE_SIM;
extern near unsigned char SIM_CARD;

extern unsigned char TempA_Str[40];
extern unsigned char TempB_Str[6];

extern unsigned char Active_IMSI[16];

extern const char* MessageBox[4];
extern unsigned char MessageType;			/* '?', '!',  */
extern unsigned char PhoneNumber[CALL_NUMBER_SIZE];
extern unsigned char LastPhoneNumber[CALL_NUMBER_SIZE];
extern unsigned char NMS_PhoneNumber[CALL_NUMBER_SIZE];
extern unsigned char ModemResponse;
extern unsigned long GlobalMoneyCounter;
extern unsigned char SMS_Message_Number; 
extern unsigned int pNMS_Phone_List;

extern void ( *Func ) ( void );	
extern void ( *Execute_Module_1) ( void );	
extern void ( *Execute_Module_2) ( void );	

//extern CDR CallDataRecord;

//extern PREFIX Prefix_Tmp;

extern unsigned char SysState, NextState, PrevState;

//extern unsigned char bank3 MessageBoxDelay;

/* Message Type */
enum
{
	INFORMATION,
	WARNING,
	CRITICAL,							  /* for ERROR */
	WARNING_AND_QUESTION
};

/* Modem Registration status  */
typedef union
{
		unsigned REGISTERED	: 	1;
		unsigned NMS_PHONE	: 	1;
		unsigned MY_PHONE		:	1;
		unsigned DATE_TIME	:	1;
		unsigned B4				:	1;
		unsigned B5				:	1;
		unsigned B6				:	1;
		unsigned B7				:	1;
		
}REGISTRATION_STATUS;


extern near REGISTRATION_STATUS RegistrationStatus;

extern void (*Execute_Module) (void);
extern const char Revision_Basic[];

//extern CDR CallDataRecord;

void Message_Box( const char* m1, const char* m2, const char* m3, const char* m4, unsigned char Message_Type, unsigned int ShowTime );
void MainStateMachine ( void );
void MainStateMachine_Init( void );
void Drive_Inputs( void );
void ModemSet( const char* Request, const char* ExpectedResponse  );
void GetNext_NMS_Number( void );

//void CheckCom( void );


#endif

